package netty;

import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;

/**
 * @Author: zhangrongqing
 * @Date: 2019/12/10 19:41
 */
public class SimpleHandler extends ChannelInboundHandlerAdapter {

    @Override
    public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
        System.out.println("服务器读取数据=====");
        System.out.println(msg);
        ctx.channel().writeAndFlush("hello,client"); //回写给客户端
    }

}
